Vehicle Class Reference

#include <Vehicle.h>

Inheritance diagram for Vehicle:

TraffEduObject List of all members.

Public Member Functions

 Vehicle ()
 Vehicle (string pathname, float scale)
void draw (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
void deletePath ()
Path * getPath ()
void setPath ()
void hidePath (osg::ref_ptr< osg::Group > root)
void displayPath (osg::ref_ptr< osg::Group > root)
void drawPath (osg::ref_ptr< osg::Group > root)
void reload (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
void setWheels (osg::ref_ptr< osg::Group > root)
void setPositionAll (float x, float y, float z)

Public Attributes

Wheel wheelObjects [4]

Private Attributes

Path path

Detailed Description

A class to implement one type of TraffEduObject, that is Vehicle.


Constructor & Destructor Documentation

Vehicle::Vehicle (   ) 
 

A constructor. default constructor.

Vehicle::Vehicle (  string  pathname,
float  scale
) 
 

A constructor.

Parameters:
pathname string argument defining path name.
scale is a float argument defining scale factor of the vehicle model. initalize path and scale factor of the vehicle model.


Member Function Documentation

void Vehicle::deletePath (   ) 
 

a normal member . delete the path of the vehicle

void Vehicle::displayPath (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. adds the path of the vehicle to the root.

void Vehicle::draw (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
)  [virtual]
 

a normal member taking two arguments.

Parameters:
root is an osg::ref_ptr to osg::Group which the model node will be added.
animationFlag is an integer flag to specify whether the root is animation window root or not. this function adds the vehicle model node to the root.

Implements TraffEduObject.

void Vehicle::drawPath (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. calls draw function of Path object.

Path* Vehicle::getPath (   ) 
 

a normal member .

Returns:
Path *. returns pointer to the path of the vehicle.

void Vehicle::hidePath (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. removes the path of the vehicle from the root.

void Vehicle::reload (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
) 
 

a normal member taking two arguments .

Parameters:
root parameter is an osg::ref_ptr to osg::Group.
animationFlag is an integer flag to specify whether the vehicle the root is animation window root or not. in editor vehicle model will be the whole model(chasis+wheel together) in animation phase vehicle models will be re-loaded as wheels and chasis seperate this function removes the older node and reloads the newer(only chasis=kasa) model

void Vehicle::setPath (   ) 
 

Setter for the Path.

void Vehicle::setPositionAll (  float  x,
float  y,
float  z
) 
 

a normal member .

Parameters:
x a float defining x coordinate.
y a float defining y coordinate.
z a float defining z coordinate. set position of all positionAttitudeTransform vectors of the vehicle.

void Vehicle::setWheels (  osg::ref_ptr< osg::Group >  root  ) 
 

a normal member .

Parameters:
root is an osg::ref_ptr to osg::Group. sets modelPath and scale factor of wheel objects of the vehicle.


Member Data Documentation

Path Vehicle::path [private]
 

Wheel Vehicle::wheelObjects[4]
 

a public variable. vehicle has wheel objects, which are initiated at the begining of animation.


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:01 2006 by  doxygen 1.4.6-NO